package com.pikaq.service.impl;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.pikaq.dao.MsgDao;
import com.pikaq.entity.Msg;
import com.pikaq.service.MsgService;
import com.pikaq.util.Util;

@Service
public class MsgServiceImpl implements MsgService {

	@Resource
	private MsgDao msgDao;
	
	public List<Msg> getMsg() {
	
		return msgDao.getMsg();
	}

	public void insert(Msg msg) {
		Msg messge = msg;
		messge.setId( UUID.randomUUID().toString());
		//messge.setDate(Util.dateformat(new Date()));
		msgDao.insertMsg(messge);

	}

}
